package vip.mtdp.asset.core.dal.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description
 * @Author Evans.wang
 * @since 2023/10/28 20:54
 **/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_account_balance")
public class AccountBalance implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long vaultId;

    private Long accountId;

    private String no;

    private String chain;

    private String coin;

    private String tokenId;
    /**
     * balance=dr-cr-frozen
     */
    private BigDecimal balance = BigDecimal.ZERO;
    private BigDecimal balanceDr = BigDecimal.ZERO;
    private BigDecimal balanceCr = BigDecimal.ZERO;
    private BigDecimal frozenBalance = BigDecimal.ZERO;
    /**
     * 是否允许为负，0=否，1=是
     */
    private Integer allowNegative;
    /**
     * 0=禁用，1=启用
     */
    private Integer state;

    //private String h;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
